package com.hulk.ratel.manage.pass.route;


import com.hulk.ratel.common.util.SpringContextHolder;
import com.hulk.ratel.manage.bo.InitiativeScanPayReqBO;
import com.hulk.ratel.manage.bo.InitiativeScanPayRespBO;
import com.hulk.ratel.manage.pass.interfaces.IScanPayApplayService;
import com.hulk.ratel.persistence.entity.LogTxnPayRecord;
import com.hulk.ratel.persistence.entity.TxncodeOrgClazz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * Created by hulk on 2017/11/9.
 * 被扫
 */
@Slf4j
@Service
public class InitiativeScanPayRoute extends BaseRoute {

    public InitiativeScanPayRespBO doPay(String orgCode, String txnCode, InitiativeScanPayReqBO reqBO, LogTxnPayRecord record) {
        TxncodeOrgClazz targetClazz = super.getPayorgClazz(orgCode, txnCode);
        IScanPayApplayService payApplayService = SpringContextHolder.getBean(targetClazz.getClazzCode());
        reqBO.setOrgCode(orgCode);
        return payApplayService.doPay(reqBO,record);
    }
}
